package com.cristina.attention.handler;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @author by superman
 */
@Component
public class ImHandlerHolder {

    private Map<Integer, ImHandler> handlers = new HashMap<Integer, ImHandler>(32);

    public void putHandler(Integer imCode, ImHandler handler) {
        handlers.put(imCode, handler);
    }

    public ImHandler route(Integer imCode) {
        return handlers.get(imCode);
    }
}
